//
//  HMTextField.m
//  ChongTaiApp
//
//  Created by Mac book on 16/5/31.
//  Copyright © 2016年 ChongTai. All rights reserved.
//

#import "HMTextField.h"

@implementation HMTextField

+ (UITextField *)createTextFieldWithText:(NSString *)text andpLlaceholder:(NSString *)placeholder andTextColor:(UIColor*)textColor andBgColor:(UIColor*)bgcolor andFont:(UIFont *)font andTextAlignment:(NSTextAlignment )textAlignment andTextFieldViewMode:(UITextFieldViewMode)textFieldViewMode{


    UITextField *textField = [[UITextField alloc]init];

    if (text) {
        textField.text = text;
    }
    if (placeholder) {
        textField.placeholder = placeholder;
    }
    if (textColor) {
        textField.textColor = textColor;
    }
    if (bgcolor) {
        textField.backgroundColor = bgcolor;
    }
    if (font) {
        [textField setFont:font];
    }
    if (textAlignment) {
        textField.textAlignment = textAlignment;
    }
    if (textFieldViewMode) {
        textField.clearButtonMode = textFieldViewMode;
    }

    return textField;
}

@end
